<?php

/**
 * search actions.
 *
 * @package    anchor
 * @subpackage search
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class searchActions extends myActions
{
	/**
	 * Executes index action
	 *
	 * @param sfRequest $request A request object
	 */
	public function executeIndex(sfWebRequest $request)
	{
		// Get query
		$this->query = $request->getParameter('query');
		// Get projects search result
		$this->projects = Doctrine_Core::getTable('Project')->getForLuceneQuery($this->query);
		// Set projects count
    $this->projects_count = count($this->projects);		
    // Get calculation list
    $this->articles = Doctrine_Core::getTable('Article')->getForLuceneQuery($this->query);
    // Get articles count
    $this->articles_count = count($this->articles); 
	}
}